package controller

import (
	"errors"
	"fmt"
)

var isActive bool

var enable, disable = true, false

func Demo() {
	//var name = "haha"
	//var c = `sdd`
	//fmt.Println(c)
	fmt.Println(isActive)
	fmt.Println(enable, disable)

	s := "hello"
	c := []byte(s) // 将字符串 s 转换为 []byte 类型
	c[0] = 'c'
	s2 := string(c) // 再转换回 string 类型
	fmt.Printf("%s\n", s2)

	err := errors.New("emit macho dwarf: elf header corrupted")
	if err != nil {
		fmt.Print(err)
	}
	demoArray()

}

/**
数组demo
*/
func demoArray() {
	var arr [10]int
	arr[0] = 42
	arr[5] = 2
	fmt.Printf("The first element is %v\n", arr[0]) // 获取数据，返回42
	fmt.Printf("%v", arr)
}
